package com.book.controller;

import com.book.pojo.Order;
import com.book.pojo.com.book.entity.Code;
import com.book.pojo.com.book.entity.Result;
import com.book.service.feign.OrderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;


/**
 * @author xuchangshuo
 * @date 2020/10/30 14:00
 */
@Controller
@RequestMapping("/order")
public class OrderController {


    @Autowired
    private OrderFeign orderFeign;

    //查询订单
    @RequestMapping("/findAllOrder")
    @ResponseBody
    public Result findAllOrder() {
        List<Order> list = orderFeign.findAll();
        return new Result(Code.SUCCESS_CODE,list);
    }
}
